Skip to content

[LOOP]-227 Capture pump component changes#536

Merged
ArwainK merged 3 commits into
devfrom
Arwain/Loop-227-capture-pump-changes
Aug 19, 2023
Merged

[LOOP]-227 Capture pump component changes#536
ArwainK merged 3 commits into
devfrom
Arwain/Loop-227-capture-pump-changes

Conversation

@ArwainK
Copy link
Copy Markdown

@ArwainK ArwainK commented Aug 18, 2023

@ArwainK ArwainK changed the title Add replaceComponent and subtypes to PumpEventType [LOOP]-227 Capture pump component changes Aug 18, 2023
@ArwainK ArwainK requested review from Camji55, nhamming and ps2 August 18, 2023 03:38
Comment thread LoopKit/InsulinKit/DoseType.swift Outdated
case .tempBasal:
self = .tempBasal
case .alarm, .alarmClear, .prime, .rewind:
case .alarm, .alarmClear, .prime, .rewind, .replaceComponent(.reservoir), .replaceComponent(.pump), .replaceComponent(.infusionSet):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case .alarm, .alarmClear, .prime, .rewind, .replaceComponent(.reservoir), .replaceComponent(.pump), .replaceComponent(.infusionSet):
case .alarm, .alarmClear, .prime, .rewind, .replaceComponent:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, much cleaner

Comment thread LoopKit/InsulinKit/NewPumpEvent.swift Outdated


public struct NewPumpEvent: Equatable {
public static func == (lhs: NewPumpEvent, rhs: NewPumpEvent) -> Bool {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite a complete equality check. Making all the subtypes Equatable should give you this automatically. Happy to help if you need!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree removed no longer needed

Comment thread LoopKit/InsulinKit/PumpEventType.swift Outdated
return [.alarm, .alarmClear, .basal, .bolus, .prime, .resume, .rewind, .suspend, .tempBasal, .replaceComponent(componentType: .reservoir), .replaceComponent(componentType: .pump), .replaceComponent(componentType: .infusionSet)]
}

public static func == (lhs: PumpEventType, rhs: PumpEventType) -> Bool {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making ReplacementComponent Equatable should give you this automatically.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree removed

Comment thread LoopKit/InsulinKit/PumpEventType.swift Outdated
case .basal:
return 9
case .replaceComponent(componentType: .reservoir):
return 4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can cause identity conflicts if all of these types have the same ID of 4. I'd make sure these are unique.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, per offline discussion will set these to 10, 11, 12 as placeholders until there is further clarification on the order.

@ArwainK ArwainK requested a review from Camji55 August 18, 2023 21:39
@ArwainK ArwainK merged commit e827d59 into dev Aug 19, 2023
@ArwainK ArwainK deleted the Arwain/Loop-227-capture-pump-changes branch August 19, 2023 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants